filechooser: Only do search_start_query() while we are in search mode
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 3 Mar 2015 16:43:14 +0000 (17:43 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 3 Mar 2015 16:57:08 +0000 (17:57 +0100)
This signal can be emitted by GtkSearchEntry after search has been
cancelled, and other operation mode is set. It doesn't make sense to
populate the search model in that state anymore, so just avoid doing it.

https://bugzilla.gnome.org/show_bug.cgi?id=745479

gtk/gtkfilechooserwidget.c

index 8789f3f276bfc2dc8246b4c0d688d199fec2706f..d1dcc84c63d1e66df2ab8298ea189919fee6c249 100644 (file)
@@ -6304,6 +6304,9 @@ search_entry_activate_cb (GtkFileChooserWidget *impl)
   GtkFileChooserWidgetPrivate *priv = impl->priv;
   const char *text;
 
+  if (priv->operation_mode != OPERATION_MODE_SEARCH)
+    return;
+
   text = gtk_entry_get_text (GTK_ENTRY (priv->search_entry));
 
   /* reset any existing query object */